#include<iostream>
#include<cmath>

using namespace std;
int a[1000000];

bool is_runnian(int x)
{
	if (x%400==0)
		return true;
	else if (x%4==0 && x%100!=0)
		return true;
	
	return false;
}
void chuli()
{
	int x,y;
	int cnt = 0;
	cin >> x >> y;
	for (int i=x;i<=y;i++)
	{
		if (is_runnian(i))
			cnt++;
	}	
	
	cout << cnt ;
}

int main()
{
	chuli();
	return 0;	
} 
